local s15__weidou = fk.CreateSkill {
  name = "s15__weidou",
  tags = { Skill.Compulsory },
}

Fk:loadTranslationTable {
  ["s15__weidou"] = "偎斗",
  [":s15__weidou"] = "锁定技，当你成为【杀】的目标后，若你的体力值不大于使用者，你令使用者选择：1. 弃置一张基本牌；2. 此【杀】对你无效。",

  ["#s15__weidou-discard"] = "偎斗：你须弃置一张基本牌，否则此【杀】对 %src 无效",
}

s15__weidou:addEffect(fk.TargetConfirmed, {
  anim_type = "defensive",
  can_trigger = function(self, event, target, player, data)
    if not (target == player and player:hasSkill(s15__weidou.name) and data.card.trueName == "slash") then
      return false
    end
    return data.from and not data.from.dead and data.from.hp >= player.hp
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    if data.from.dead or #room:askToDiscard(data.from, {
          min_num = 1,
          max_num = 1,
          include_equip = false,
          skill_name = s15__weidou.name,
          cancelable = true,
          pattern = ".|.|.|.|.|basic",
          prompt = "#s15__weidou-discard:" .. player.id,
        }) == 0 then
      data.nullified = true
    end
  end,
})

return s15__weidou
